﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI;
using System.ComponentModel;

namespace TA.Turbo
{
	/// <summary>
	/// Base class for all controls used by Turbo.
	/// </summary>
	public abstract class BaseControl : Control
	{
		#region PUBLIC
		#region PROPS
		/// <summary>
		/// Gets the <see cref="TA.Turbo.TPage"/> which contains this control.
		/// </summary>
		[Browsable(false)]
		public TPage TPage
		{
			get
			{
				return this.Page as TPage;
			}
		}
		/// <summary>
		/// This property has no effect.
		/// </summary>
		[EditorBrowsable(EditorBrowsableState.Never)]
		[Browsable(false)]
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
		public override bool EnableViewState
		{
			get
			{
				return base.EnableViewState;
			}
			set
			{
				base.EnableViewState = value;
			}
		}
		#endregion
		#region EVENTS
		/// <summary>
		/// Not used.
		/// </summary>
		/// <remarks>
		/// This declaration hides the inherited ASP.NET event which is not used by Turbo.
		/// </remarks>
		[EditorBrowsable(EditorBrowsableState.Never)]
		[Browsable(false)]
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
		public new event EventHandler Load;
		/// <summary>
		/// Not used.
		/// </summary>
		/// <remarks>
		/// This declaration hides the inherited ASP.NET event which is not used by Turbo.
		/// </remarks>
		[EditorBrowsable(EditorBrowsableState.Never)]
		[Browsable(false)]
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
		public new event EventHandler PreRender;
		/// <summary>
		/// Not used.
		/// </summary>
		/// <remarks>
		/// This declaration hides the inherited ASP.NET event which is not used by Turbo.
		/// </remarks>
		[EditorBrowsable(EditorBrowsableState.Never)]
		[Browsable(false)]
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
		public new event EventHandler DataBinding;
		/// <summary>
		/// Not used.
		/// </summary>
		/// <remarks>
		/// This declaration hides the inherited ASP.NET event which is not used by Turbo.
		/// </remarks>
		[EditorBrowsable(EditorBrowsableState.Never)]
		[Browsable(false)]
		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
		public new event EventHandler Unload;
		#endregion
		#endregion
	}
}
